<%@ page language="java" import="java.util.*,shop.dao.*" 	pageEncoding="utf-8"%>
<% 
	String username=(String)session.getAttribute("username");
	if(username=="" || username==null)
	{
		out.println("<script language='javascript'>alert('请先登录!');window.location.href='index.jsp';</script>");
	}
	else
	{
		CartBean cb=new CartBean();
		int ID=Integer.parseInt(request.getParameter("ID"));
		Vector cart=(Vector)session.getAttribute("cart");	
		int temp=cb.deleteCart(ID,cart);
		if (temp!=0)
		{
			out.println("<script language=javascript> alert('ok');</script>");
			response.sendRedirect("../shop_cart.jsp");
		}
		else
		{
			response.sendRedirect("../index.jsp");
		}
	}
 %>